<template>
  <div class="home_sidebar">
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-submenu index="1" v-for="(item, index) in menuConfig" :key="index">
        <template slot="title">
          <i :class="item.icon"></i>
          <span>{{ item.title }}</span>
        </template>
        <el-menu-item index="1-4-1" v-for="(subitem,subindex) in item.sub" :key="subindex">{{subitem.title}}</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      menuConfig: [
        {
          title: "商品管理",
          icon: "el-icon-delete-solid",
          sub: [
            { title: "商品列表" },
            { title: "商品分类" },
            { title: "品牌管理" },
            { title: "商品属性管理" },
          ]
        },
        {
          title: "订单中心",
          icon: "el-icon-delete-solid",
          sub: [
            { title: "订单列表" }
          ]
        },
        {
          title: "店铺运营",
          icon: "el-icon-delete-solid",
          sub: [
            { title: "专题管理" },
            { title: "运营数据" }
          ]
        },
      ],
    };
  },
};
</script>
 
<style lang = "less" scoped>
.home_sidebar {
  display: block;
  position: absolute;
  left: 0;
  top: 70px;
  bottom: 0;
  overflow-y: scroll;
}
</style>